import { TdBaseTableProps } from 'tdesign-vue-next';

import { t } from '@/locales';

export interface DashboardType {
  count: Recordable;
  categoryCount: Recordable;
  clickCount: Recordable;
  hotArticle: Recordable[];
  tagRank: TagItem[];
}

export interface TagItem {
  tag: string;
  count: number;
  range?: number;
}

export const DASHBOARD_DATA: DashboardType = {
  count: {},
  categoryCount: {},
  clickCount: {},
  hotArticle: [],
  tagRank: [],
};

export const PANEL_DATA = [
  {
    title: 'pages.dashboardBase.topPanel.card1',
    number: 0,
    icon: 'article',
  },
  {
    title: 'pages.dashboardBase.topPanel.card2',
    number: 0,
    icon: 'tree-list',
  },
  {
    title: 'pages.dashboardBase.topPanel.card3',
    number: 0,
    icon: 'hashtag',
  },
  {
    title: 'pages.dashboardBase.topPanel.card4',
    number: 0,
    icon: 'file-attachment',
  },
];

export const HOT_COLUMNS: TdBaseTableProps['columns'] = [
  {
    align: 'center',
    colKey: 'index',
    title: () => t('pages.dashboardBase.hot.columns.index'),
    width: 100,
    fixed: 'left',
  },
  {
    align: 'left',
    ellipsis: true,
    colKey: 'title',
    title: () => t('pages.dashboardBase.hot.columns.title'),
  },
  {
    align: 'center',
    colKey: 'count',
    title: () => t('pages.dashboardBase.hot.columns.count'),
    width: 100,
  },
];
